package fr.inserm.u915.organifooyi.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

@MappedSuperclass
public abstract class AbstractUpdatableObject extends AbstractPersistentObject
	{
	@Version
	private Long version;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="modified_by")
	private User modifiedBy;

	protected AbstractUpdatableObject()
		{
		}
	
	@Column(name="modified")
	@Temporal(TemporalType.TIMESTAMP)
	private Date modified=null;
	
	public Long getVersion()
		{
		return version;
		}
	
	
	protected void setVersion(Long version)
		{
		this.version=version;
		}


public Date getModified()
	{
    return modified;
	}

public void setModified(Date modified)
	{
	this.modified=modified;
	}

	
public User getModifiedBy() {
	return modifiedBy;
}

public void setModifiedBy(User modifiedBy) {
	this.modifiedBy = modifiedBy;
}

}
